<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<TITLE><?php echo $param_id ?> - 可视化编辑</TITLE>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="<?php echo getcdnurlhost() ?>/admin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="<?php echo getcdnurlhost() ?>/admin/style/admin.css" media="all">
<link rel="stylesheet" href="<?php echo getcdnurlhost() ?>/DivTemplates/DivTemplate.css" media="all">
</head>
<body class="layui-layout-body hdsys-body" data="HDSYSCMS 2021本系统受国家版权局保护请勿破解或者二次开发传播">
<div id="LAY_app" class="layadmin-tabspage-none ">
<div class="layui-layout layui-layout-admin">
<div style="" class="layui-header">
<ul class="layui-nav layui-layout-left">
<li class="layui-nav-item" lay-unselect="">
<a href="javascript:;" class="hdsys-set" title="当前页面设置">
<i class="layui-icon layui-icon-set"></i>
</a>
</li>
<li class="layui-nav-item layui-hide-xs" lay-unselect="">
<form class="layui-form" id="form" onsubmit="return false;" action="">
<div class="layui-col-md6 layui-form" style="padding-top: 6px;width: 400px;">
<select name="template" id="template" lay-filter="template" lay-verify="required" lay-search>
<option value="">选择模版页面,支持输入字母检索</option>
<?php
$param_id=call_my_str_replace('/', '', $param_id);
$param_id=call_my_str_replace('\\', '', $param_id);
$param_id=call_my_str_replace('..', '', $param_id);
$param_dir=HDSYS_DIR_SYS . 'templates/' . $param_id  . '';
if (!is_dir($param_dir)) {
print_json(array(call_my_str_code()=> call_my_int_1(), call_my_str_msg()=> '目录不存在 ' . 'templates/' . $param_id  . ''));
}
$param_dir_list=call_my_read_dir_file($param_dir);
$showinfo='';
$param_while_array_list_all=array();
$param_tmp_rows=0;
$param_dir=HDSYS_DIR_SYS . 'templates/' . $param_id  . '';
rsort($param_dir_list);
foreach ($param_dir_list as $param_file) {
$param_file_show=str_replace($param_dir . '/', '', $param_file);
if (is_file($param_file)) {
if (stripos($param_file_show, '.hdsys.php') > 0) {
$param_tmp_rows++;
$param_names=call_my_Template_name($param_file_show);
echo "<option value='{$param_file_show}'>{$param_tmp_rows}. {$param_file_show} ({$param_names})</option>";
}
}
}
?>
</select>
</div>
</form>
</li>
</ul>
<ul class="layui-nav layui-layout-right" style="padding-top:6px" lay-filter="layadmin-layout-right">
<li class="layui-nav-item" lay-unselect="">
<a href="javascript:;" layadmin-event="refresh" title="刷新">
<i class="layui-icon layui-icon-refresh-3"></i>
</a>
</li>
<li class="layui-nav-item" lay-unselect="">
<a href="javascript:;" class="opennew" title="独立窗口打开">
<i class="layui-icon layui-icon-website"></i>
</a>
</li>
</ul>
</div>
<div style="margin-top: 0px;" class="layui-side layui-side-menu">
<div class="layui-side-scroll1">
<div class="hdsys-logo" style="background-color: #20222a00 !important;z-index:9999;">
<span>可视化建站</span>
</div>
<div style="margin-top: 63px;" class="mode-list">
</div>
</div>
</div>
<div class="layui-body" id="LAY_app_body">
<div class="layadmin-tabsbody-item layui-show">
<iframe id="iframe" src="" frameborder="0" class="layadmin-iframe"></iframe>
</div>
</div>
<div class="layadmin-body-shade" layadmin-event="shade"></div>
</div>
</div>
<?php adminechohtnl(); ?>
<script src="<?php echo getcdnurlhost() ?>/admin/layui/layui.js"></script>
<script src="<?php echo getcdnurlhost() ?>/jquery.min.js"></script>
<script>var HDSYS_CODE='0';var HDSYS_CONFIG=[];layui.config({base: '<?php echo getcdnurlhost() ?>/admin/'}).extend({index: 'lib/index'}).use(['jquery', 'index', 'layer', 'form', 'element'], function() {var admin=layui.admin,layer=layui.layer,form=layui.form,$=layui.$,table=layui.table;var element=layui.element;form.on('select(template)', function(data) {layer.load(1);$.ajax({type: "post",url: 'index.php?m=manage&c=Template&a=template_open_ajax',data: {file: HDSYS_CONFIG.file,open: data.value,dir: HDSYS_CONFIG.dir},dataType: "json",success: function(ret) {layer.closeAll('loading');if (ret.code==1) {document.getElementById('iframe').contentWindow.location.href=ret.url;} else {layer.msg(ret.msg);}if (typeof ret.push !='undefined') {if (ret.push !='') {layer.alert(ret.push);}}}});});window.top_init=function(code, config) {HDSYS_CODE=code;HDSYS_CONFIG=config;console.log(config);if (code==1000) {$(".mode-list").html('<div   class="mode-box  bins bind-new-file">创建模版</div>');}if (code=='0') {get_mode_info();}};$(document).on('click', ".bind-add-mode", function(e) {layer.load(1);$.ajax({type: "post",url: 'index.php?m=manage&c=<?php echo set_get('c'); ?>&a=add_mode_ajax',data: {file: HDSYS_CONFIG.file,dir: HDSYS_CONFIG.dir},dataType: "json",success: function(ret) {layer.closeAll('loading');if (ret.code==1000) {layer.msg(ret.msg);document.getElementById('iframe').contentWindow.location.reload();} else {layer.msg(ret.msg);}if (typeof ret.push !='undefined') {if (ret.push !='') {layer.alert(ret.push);}}}});});$(document).on('click', ".bind-new-file", function(e) {layer.load(1);$.ajax({type: "post",url: 'index.php?m=manage&c=<?php echo set_get('c'); ?>&a=new_file_ajax',data: {file: HDSYS_CONFIG.file,dir: HDSYS_CONFIG.dir,},dataType: "json",success: function(ret) {layer.closeAll('loading');if (ret.code==1000) {layer.msg(ret.msg);document.getElementById('iframe').contentWindow.location.reload();} else {layer.msg(ret.msg);}if (typeof ret.push !='undefined') {if (ret.push !='') {layer.alert(ret.push);}}}});});$(document).on('click', ".hdsys-age", function(e) {hdsys_age($(this).attr('data-id'), '');});window.hdsys_age=function(id, div_id) {var layid=layer.open({type: 2,title: "",area: ['80%', '80%'],fixed: false,maxmin: false,content: 'index.php?m=manage&c=Div&a=age&dir=' + HDSYS_CONFIG.dir + '&id=' + id + '&file=' + HDSYS_CONFIG.file + '&div_id=' + div_id});};$(document).on('click', ".hdsys-Html", function(e) {if ($(this).attr('data-file')=='') {layer.msg('请先添加模块在进行编辑.');return;}var layid=layer.open({type: 2,title: '',area: ['85%', '85%'],fixed: false,maxmin: false,content: 'index.php?m=manage&c=Div&a=html&dir=' + HDSYS_CONFIG.dir + '&id=' + $(this).attr('data-id') + '&file=' + HDSYS_CONFIG.file});return;});$(document).on('click', ".hdsys-empty", function(e) {layer.load(1);$.ajax({type: "post",url: 'index.php?m=manage&c=<?php echo set_get('c'); ?>&a=empty_ajax',data: {file: HDSYS_CONFIG.file,dir: HDSYS_CONFIG.dir,id: $(this).attr('data-id')},dataType: "json",success: function(ret) {layer.closeAll('loading');document.getElementById('iframe').contentWindow.location.reload();if (typeof ret.push !='undefined') {if (ret.push !='') {layer.alert(ret.push);}}}});return;});$(document).on('click', ".hdsys-cutout", function(e) {layer.load(1);$.ajax({type: "post",url: 'index.php?m=manage&c=<?php echo set_get('c'); ?>&a=cutout_ajax',data: {file: HDSYS_CONFIG.file,dir: HDSYS_CONFIG.dir,id: $(this).attr('data-id')},dataType: "json",success: function(ret) {layer.closeAll('loading');document.getElementById('iframe').contentWindow.location.reload();if (typeof ret.push !='undefined') {if (ret.push !='') {layer.alert(ret.push);}}}});return;});$(document).on('click', ".hdsys-edit", function(e) {var layid=layer.open({type: 2,title: '',area: ['80%', '80%'],fixed: false,maxmin: false,content: 'index.php?m=manage&c=Div&a=mode&dir=' + HDSYS_CONFIG.dir + '&id=' + $(this).attr('data-id') + '&file=' + HDSYS_CONFIG.file});return;});$(document).on('click', ".hdsys-set", function(e) {var layid=layer.open({type: 2,title: "",area: ['800px', '500px'],fixed: false,maxmin: false,content: 'index.php?m=manage&c=Div&a=mode_set&dir=' + HDSYS_CONFIG.dir + '&id=' + $(this).attr('data-id') + '&file=' + HDSYS_CONFIG.file});return;});$(document).on('click', ".hdsys-up", function(e) {layer.load(1);$.ajax({type: "post",url: 'index.php?m=manage&c=<?php echo set_get('c'); ?>&a=up_ajax',data: {file: HDSYS_CONFIG.file,dir: HDSYS_CONFIG.dir,id: $(this).attr('data-id')},dataType: "json",success: function(ret) {layer.closeAll('loading');document.getElementById('iframe').contentWindow.location.reload();if (typeof ret.push !='undefined') {if (ret.push !='') {layer.alert(ret.push);}}}});return;});$(document).on('click', ".opennew", function(e) {window.open(document.getElementById('iframe').contentWindow.location.href);return;});$(document).on('click', ".hdsys-down", function(e) {layer.load(1);$.ajax({type: "post",url: 'index.php?m=manage&c=<?php echo set_get('c'); ?>&a=down_ajax',data: {file: HDSYS_CONFIG.file,dir: HDSYS_CONFIG.dir,id: $(this).attr('data-id')},dataType: "json",success: function(ret) {layer.closeAll('loading');document.getElementById('iframe').contentWindow.location.reload();if (typeof ret.push !='undefined') {if (ret.push !='') {layer.alert(ret.push);}}}});return;});window.get_mode_info=function() {layer.load(1);$.ajax({type: "post",url: 'index.php?m=manage&c=<?php echo set_get('c'); ?>&a=get_mode_ajax',data: {file: HDSYS_CONFIG.file,dir: HDSYS_CONFIG.dir,},dataType: "json",success: function(ret) {layer.closeAll('loading');if (ret.code==1000) {select_set_text('template', HDSYS_CONFIG.file);var html='';var mode=ret.data.mode;mode.forEach(item=> {html=html + '<li data-id="' + item.id + '" class=" mode-box  layui-nav-item" ><a href="javascript:;"  data-id="' + item.id + '"  class="hdsys-edit hdsys-bint-box" ><i>' + item.name + '</i><i class="filename">' + item.file + '</i></a> ';html=html + '<dl class="layui-nav-child">';html=html + '<dd><a  data-id="' + item.id + '"  data-file="' + item.file + '" class="hdsys-age" href="javascript:;">动态标签</a></dd>';html=html + '<dd><a  data-id="' + item.id + '"  data-file="' + item.file + '" class="hdsys-Html" href="javascript:;">编辑模版代码</a></dd>';html=html + '<dd><a  data-id="' + item.id + '"  data-file="' + item.file + '" class="hdsys-edit" href="javascript:;">变更模块</a></dd>';html=html + '<dd><a class="hdsys-up"  data-id="' + item.id + '"  href="javascript:;">向上移动</a></dd>';html=html + '<dd><a class="hdsys-down" data-id="' + item.id + '"  href="javascript:;">向下移动</a></dd>';html=html + '<dd><a class="hdsys-empty" data-id="' + item.id + '"  href="javascript:;">清空模块</a></dd>';html=html + '<dd><a class="hdsys-cutout" data-id="' + item.id + '"  href="javascript:;">删除模块</a></dd>';html=html + '</dl>';html=html + '</li>';});$(".mode-list").html('<ul class="layui-nav" lay-filter="">' + html + '</ul> <div  class="mode-box  bins bind-add-mode">新增模块</div>');element.render();form.render();if (typeof ret.push !='undefined') {if (ret.push !='') {layer.alert(ret.push);}}} else {layer.msg(ret.msg);}}});};$("iframe").attr('src', "<?php echo $param_url; ?>");$("iframe").load(function() {layer.load(1);$.ajax({type: "post",url: 'index.php?m=manage&c=<?php echo set_get('c'); ?>&a=get_config_ajax',data: {file: HDSYS_CONFIG.file,dir: HDSYS_CONFIG.dir,url: encodeURIComponent(document.getElementById("iframe").contentWindow.location.href)},dataType: "json",success: function(ret) {layer.closeAll('loading');if (ret.code==-1) {layer.msg(ret.msg);} else {top_init(ret.code, {file: ret.file,dir: ret.dir});}}});});});</script>
<style>.layadmin-side-spread-sm .sm-logo {display: block;}.sm-logoa {margin-top: 20px;font-size: 16px;display: none;}.layadmin-side-spread-sm .l-logo {display: none;}@media screen and (max-width: 992px) {.layui-layout-admin .layui-side {transform: translate3d(0px, 0, 0);-webkit-transform: translate3d(0px, 0, 0);width: 220px}.layadmin-pagetabs,.layui-layout-admin .layui-body,.layui-layout-admin .layui-footer,.layui-layout-admin .layui-layout-left {left: 220px}}@media screen and (max-width: 992px) {.layadmin-pagetabs,.layui-layout-admin .layui-body,.layui-layout-admin .layui-footer,.layui-layout-admin .layui-layout-left {left: 220px;}}.hdsys-logo {margin-top: 6px;position: fixed;left: 0;top: 0;z-index: 1002;width: 220px;height: 49px;padding: 0 15px;box-sizing: border-box;overflow: hidden;font-weight: 800;background-repeat: no-repeat;background-position: center center;font-size: 23px;display: flex;align-items: center;justify-content: center;}.hdsys-logo span {text-align: center;color: rgba(255, 255, 255, .8);}.layui-input,.layui-select,.layui-textarea {height: 38px;line-height: 1.3;line-height: 38px\9;border-width: 1px;border-style: solid;background-color: #031430;color: #fff;border-radius: 2px;}.layui-badge-rim,.layui-border,.layui-colla-content,.layui-colla-item,.layui-collapse,.layui-elem-field,.layui-form-pane .layui-form-item[pane],.layui-form-pane .layui-form-label,.layui-input,.layui-layedit,.layui-layedit-tool,.layui-panel,.layui-quote-nm,.layui-select,.layui-tab-bar,.layui-tab-card,.layui-tab-title,.layui-tab-title .layui-this:after,.layui-textarea {border-color: #aec8e2;}.layui-nav {position: relative;padding: 0 20px;background-color: #393D49;color: #031430;border-radius: 2px;font-size: 0;}.layui-form-select dl dd.layui-this {background-color: #031430;color: #fff;}</style>
</body>
</html>